import logging
import unittest,time
from selenium import webdriver
from po_A3mall.Page.Page1 import Page1
from po_A3mall.Page.Page2 import Page2
from po_A3mall.Tools.Tools import Tools

class TestCase(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(10)
        Tools().log()


    def tearDown(self):
        time.sleep(3)
        self.driver.quit()


    def test_01(self):
        logging.info('start case')
        po = Page1(self.driver)
        po.A3mall_01()
        logging.info('case end')


    def test_02(self):
        logging.info('start case')
        po = Page2(self.driver)
        po.A3mall_01()
        time.sleep(1)
        po.ms()
        po.img()
        time.sleep(2)
        print(po.dy2())
        po.buy()
        po.address()
        po.next()
        time.sleep(2)
        print(po.dy3())
        logging.info('case end')

if __name__ == '__main__':
    unittest.main()